<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    async function fn() {
    //await 
    // 要和async 配合使用  await 后面是promise对象  await修饰的promise对象 直接返回执行结果
   let res =  await new Promise((resolve,reject) => {
        if(true){
            resolve({msg:'我是你爹'})
        }else {
            reject({msg:'你不是'})
        }
     })
     console.log(res);
    }
    fn();
</script>